package com.briup.ch07.object;
enum Gender{
    MALE(66),FEMALE("女生",88);//两个元素所以默认打印2次
    private String desc;
    private int positon;
    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    Gender() {
        this.positon=66;
        System.out.println("wu can gou zao qi");
    }

    Gender(String desc) {
        this.desc = desc;
    }
    Gender(int positon)
    {
        this.positon=positon;
    }
    Gender(String desc,int positon)
    {
        this.positon=positon;
        this.desc=desc;
    }

    public int getPositon() {
        return positon;
    }
}
public class Test_Enum {
    public static void main(String[] args) {
        Gender g1=Gender.MALE;
        Gender g2=Gender.FEMALE;
        System.out.println(g1);
        System.out.println(g2);
        switch(g1)
        {
            case MALE:
                System.out.println("nan");
                break;
            case FEMALE:
                System.out.println("nv");
                break;
        }
        if(g1==Gender.MALE)
        {
            System.out.println("nan");
        }
        else{
            System.out.println("nv");
        }
        System.out.println(g1.ordinal());
        System.out.println(g2.ordinal());
        System.out.println(g2.getDesc());
    }
}
